Skip to content

Fix preview deploys for PRs targeting version branches#14066

Merged
matthewp merged 1 commit into
mainfrom
fix-preview-alias
Jun 15, 2026
Merged

Fix preview deploys for PRs targeting version branches#14066
matthewp merged 1 commit into
mainfrom
fix-preview-alias

Conversation

@matthewp

Copy link
Copy Markdown
Contributor

Preview deploys for PRs targeting version branches (e.g. v7) were broken. The deploy succeeded but the preview URL returned 'not found'.

Root cause: The versions upload --preview-alias command was using the Worker name from wrangler.jsonc in the build output. For PRs targeting v7, this uploaded the preview to the docs-v7 Worker, but the preview URL (*.previews.docs.astro.build) is only configured on the main docs Worker.

Fix: Pass --name docs to always upload preview aliases to the main Worker, regardless of which branch the PR targets.

Fixes the broken preview on #14065.

Preview aliases were being uploaded to the version branch's Worker
(e.g. docs-v7) but the preview URL uses *.previews.docs.astro.build
which is only configured on the main docs Worker. Override the Worker
name to always upload previews to the docs Worker.
@netlify

netlify Bot commented Jun 15, 2026

Copy link
Copy Markdown

Deploy Preview for astro-docs-2 failed. Why did it fail? →

Name Link
🔨 Latest commit b5199f9
🔍 Latest deploy log https://app.netlify.com/projects/astro-docs-2/deploys/6a3027e9327edc0008802bcf

@github-actions

github-actions Bot commented Jun 15, 2026

Copy link
Copy Markdown

Preview deployment

✅ Deployment complete!

@ArmandPhilippot ArmandPhilippot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought this was related to this change on the v7 branch #13872 (comment)

But, well, I'm not a Cloudflare expert... I trust you! 😄

@matthewp

Copy link
Copy Markdown
Contributor Author

It's not related, I'll explain there.

@matthewp matthewp merged commit 10ef8ba into main Jun 15, 2026
10 of 14 checks passed
@matthewp matthewp deleted the fix-preview-alias branch June 15, 2026 16:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants